public class ThreadTest {

    // 继承Thread类并重写run方法
    public static class MyThread extends Thread {

        @Override
        public void run() {
            System.out.println("I am a child thread");
        }
    }

    public static void main(String[] args) {
        MyThread thread = new MyThread();

        thread.start();
    }
}

